Skip to content

feat: cache key param stability, cursor debug helper, health failure test, creator list query docs#335

Merged
Chucks1093 merged 1 commit into
accesslayerorg:mainfrom
Akanimoh12:feat/cache-key-stability-cursor-debug-health-test-query-docs
May 28, 2026
Merged

feat: cache key param stability, cursor debug helper, health failure test, creator list query docs#335
Chucks1093 merged 1 commit into
accesslayerorg:mainfrom
Akanimoh12:feat/cache-key-stability-cursor-debug-health-test-query-docs

Conversation

@Akanimoh12

Copy link
Copy Markdown
Contributor

Summary

  • Add helper for computing cache key stability across equivalent query param orderings #318 — Added buildCanonicalParamString helper (src/utils/cache-key-params.utils.ts) that sorts query params lexicographically before cache key generation. Wired it into buildCreatorFeedCacheKey so two requests with identical params in a different order always resolve to the same cache entry. Unit tests confirm ordering independence, undefined omission, and full creator feed param equivalence.

  • Add helper for converting pagination cursor to debug-readable format #313 — Added formatCursorForDebug helper (src/utils/cursor-debug.utils.ts) that decodes an opaque pagination cursor into a human-readable key-value map for structured logging. Returns null for tampered, malformed, or non-string input so call sites never throw. Wired into checkIndexerCursorStalenessFromStore at logger.debug level only — never appears in info-level or higher log paths. Unit tests cover valid payloads, type coercion, tampered cursors, and edge inputs.

  • Add integration test for health endpoint under simulated dependency failure #314 — Added health.controllers.integration.test.ts that simulates database unavailability for both the /ready and /detailed health endpoints. Asserts 503 status code, ready: false / disconnected database state, unhealthy service flags, and that the full response body continues to conform to the documented schema even when the dependency is down.

  • Add docs for creator list query parameter precedence rules #315 — Added docs/api/creator-list-query-precedence.md documenting the precedence rules for conflicting and overlapping creator list query parameters: sort/order coupling, cursor vs offset priority, AND semantics for search and verified when both are present, filter-before-sort ordering, strict unknown-key rejection (400), and repeated-parameter handling. Placed alongside existing API docs with cross-references to the relevant source files and schema.

Testing

  • pnpm lint
  • pnpm build

Checklist

  • Linked issue or backlog item
  • No secrets or live credentials added
  • Docs updated if setup or env changed
  • Change is scoped to one problem

Closes #318
Closes #313
Closes #314
Closes #315

…creator list docs

Closes accesslayerorg#318 — add buildCanonicalParamString helper that sorts query params
lexicographically before cache key generation, wire it into
buildCreatorFeedCacheKey so equivalent param sets always map to the same
cache entry, add unit tests covering ordering, omission of undefined values,
and creator feed param equivalence.

Closes accesslayerorg#313 — add formatCursorForDebug helper that decodes a pagination
cursor into a human-readable key-value map for structured debug logging;
returns null for tampered, malformed, or non-string input so call sites
never throw. Wire it into checkIndexerCursorStalenessFromStore at debug
level only. Add unit tests for valid payloads, tampered cursors, and edge
input types.

Closes accesslayerorg#314 — add health.controllers.integration.test.ts that simulates
database unavailability for both the readiness and detailed health
endpoints; asserts 503 status, degraded service flags, and that the
response body continues to conform to the documented schema under failure.

Closes accesslayerorg#315 — add docs/api/creator-list-query-precedence.md documenting
sort+order coupling, cursor vs offset priority, AND semantics for search
and verified, filter-before-sort ordering, strict unknown-key rejection,
and repeated-param behaviour. Placed alongside existing API docs with
cross-references to the relevant source files.
@drips-wave

drips-wave Bot commented May 28, 2026

Copy link
Copy Markdown

@Akanimoh12 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Chucks1093 Chucks1093 merged commit 32b3ad7 into accesslayerorg:main May 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants